/*    */ package com.zimbra.cs.index.analysis;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import java.io.Reader;
/*    */ import org.apache.lucene.analysis.Tokenizer;
/*    */ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
/*    */ import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class NumberTokenizer
/*    */   extends Tokenizer
/*    */ {
/* 34 */   private int endPos = 0;
/* 35 */   private CharTermAttribute termAttr = (CharTermAttribute)addAttribute(CharTermAttribute.class);
/* 36 */   private OffsetAttribute offsetAttr = (OffsetAttribute)addAttribute(OffsetAttribute.class);
/*    */   
/*    */   public NumberTokenizer(Reader reader) {
/* 39 */     super(reader);
/*    */   }
/*    */   
/*    */   public boolean incrementToken() throws IOException
/*    */   {
/* 44 */     clearAttributes();
/*    */     
/* 46 */     int startPos = this.endPos;
/* 47 */     StringBuilder buf = new StringBuilder(10);
/*    */     for (;;)
/*    */     {
/* 50 */       int c = this.input.read();
/* 51 */       this.endPos += 1;
/* 52 */       switch (c) {
/*    */       case -1: 
/* 54 */         if (buf.length() == 0) {
/* 55 */           return false;
/*    */         }
/*    */       
/*    */       case 9: 
/*    */       case 32: 
/* 60 */         if (buf.length() != 0) {
/* 61 */           this.termAttr.setEmpty().append(buf);
/* 62 */           this.offsetAttr.setOffset(startPos, this.endPos - 1);
/* 63 */           return true;
/*    */         }
/*    */         break;
/*    */       case 48: 
/*    */       case 49: 
/*    */       case 50: 
/*    */       case 51: 
/*    */       case 52: 
/*    */       case 53: 
/*    */       case 54: 
/*    */       case 55: 
/*    */       case 56: 
/*    */       case 57: 
/* 76 */         buf.append((char)c);
/*    */       }
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/index/analysis/NumberTokenizer.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */